package com.lg.erp.service.impl.chenjunhui;

import com.lg.erp.entity.chenjunhui.TProductionLine;
import com.lg.erp.mapper.chenjunhui.TProductionLineMapper;
import com.lg.erp.service.chenjunhui.ITProductionLineService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lg
 * @since 2021-04-20
 */
@Service
public class TProductionLineServiceImpl extends ServiceImpl<TProductionLineMapper, TProductionLine> implements ITProductionLineService {

    @Autowired
    private TProductionLineMapper tProductionLineMapper;

    @Override
    public void addTProductionLine(TProductionLine tProductionLine) {
        if (tProductionLine.getState() == ""){
            tProductionLine.setState("0");
        }
        tProductionLine.setNum(Integer.valueOf(tProductionLine.getNum()));
        tProductionLineMapper.insert(tProductionLine);
    }

    @Override
    public void deleteTProductionLine(String id) {
        System.out.println(1);
        tProductionLineMapper.deleteById(id);
    }

    @Override
    public List<TProductionLine> getTProductionLines(String state) {
        return tProductionLineMapper.selectTProductionLines(state);
    }
}
